package com.example.lol;

import android.os.Bundle;
import android.view.View;
import android.view.Menu;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.navigation.NavigationView;

import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

public class MainActivity extends AppCompatActivity {

    private AppBarConfiguration mAppBarConfiguration;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


//        Toolbar toolbar = findViewById(R.id.toolbar);
//        setSupportActionBar(toolbar);
//        FloatingActionButton fab = findViewById(R.id.fab);
//        fab.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
//                        .setAction("Action", null).show();
//            }
//        });
//        DrawerLayout drawer = findViewById(R.id.drawer_layout);
//        NavigationView navigationView = findViewById(R.id.nav_view);
//        // Passing each menu ID as a set of Ids because each
//        // menu should be considered as top level destinations.
//        mAppBarConfiguration = new AppBarConfiguration.Builder(
//                R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow)
//                .setDrawerLayout(drawer)
//                .build();
//        NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
//        NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
//        NavigationUI.setupWithNavController(navigationView, navController);

        // 扫描
        ImageView LeftScan = findViewById(R.id.left_nav_head_scan);
        LeftScan.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "点击扫描", Toast.LENGTH_SHORT).show();
            }
        });

        //查看更多
        ImageView LeftLookmore = findViewById(R.id.left_nav_head_lookmore);
        LeftLookmore.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "查看更多", Toast.LENGTH_SHORT).show();
            }
        });

        //头像
        ImageView LeftUserHead = findViewById(R.id.left_nav_user_head);
        LeftUserHead.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "用户头像", Toast.LENGTH_SHORT).show();
            }
        });

        //用户名
        TextView LeftUserName = findViewById(R.id.left_nav_head_user_name);
        LeftUserName.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "用户名", Toast.LENGTH_SHORT).show();
            }
        });

        //等级
        TextView LeftLevel = findViewById(R.id.left_nav_head_level);
        LeftLevel.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "用户等级", Toast.LENGTH_SHORT).show();
            }
        });

        //性别
        ImageView LeftSex = findViewById(R.id.left_nav_head_sex);
        LeftSex.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "用户性别", Toast.LENGTH_SHORT).show();
            }
        });

        //个性签名
        TextView LeftSign = findViewById(R.id.left_nav_head_sign);
        LeftSign.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "个性签名", Toast.LENGTH_SHORT).show();
            }
        });

        //我的评论
        ImageView LeftCommentImg = findViewById(R.id.left_nav_menu_comment_img);
        LeftCommentImg.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "我的评论", Toast.LENGTH_SHORT).show();
            }
        });

        TextView LeftComment = findViewById(R.id.left_nav_menu_comment);
        LeftComment.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "我的评论", Toast.LENGTH_SHORT).show();
            }
        });

        //与我相关
        ImageView LeftRelateImg = findViewById(R.id.left_nav_menu_relate_img);
        LeftRelateImg.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "与我相关", Toast.LENGTH_SHORT).show();
            }
        });

        TextView LeftRelate = findViewById(R.id.left_nav_menu_relate);
        LeftRelate.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "与我相关", Toast.LENGTH_SHORT).show();
            }
        });

        //我的订单
        ImageView LeftOrderImg = findViewById(R.id.left_nav_menu_order_img);
        LeftOrderImg.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "我的订单", Toast.LENGTH_SHORT).show();
            }
        });

        TextView LeftOrder = findViewById(R.id.left_nav_menu_order);
        LeftOrder.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "我的订单", Toast.LENGTH_SHORT).show();
            }
        });

        //我的任务
        ImageView LeftTaskImg = findViewById(R.id.left_nav_menu_task_img);
        LeftTaskImg.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "我的任务", Toast.LENGTH_SHORT).show();
            }
        });

        TextView LeftTask = findViewById(R.id.left_nav_menu_task);
        LeftTask.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "我的任务", Toast.LENGTH_SHORT).show();
            }
        });

        //我的收藏
        ImageView LeftCollectionImg = findViewById(R.id.left_nav_menu_collection_img);
        LeftCollectionImg.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "我的收藏", Toast.LENGTH_SHORT).show();
            }
        });

        TextView LeftCollection = findViewById(R.id.left_nav_menu_collection);
        LeftCollection.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "我的收藏", Toast.LENGTH_SHORT).show();
            }
        });

        //活动中心
        ImageView LeftActImg = findViewById(R.id.left_nav_menu_act_img);
        LeftActImg.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "活动中心", Toast.LENGTH_SHORT).show();
            }
        });

        TextView LeftAct = findViewById(R.id.left_nav_menu_act);
        LeftAct.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "活动中心", Toast.LENGTH_SHORT).show();
            }
        });

        //信用分
        ImageView LeftCreditImg = findViewById(R.id.left_nav_menu_credit_img);
        LeftCreditImg.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "信用分", Toast.LENGTH_SHORT).show();
            }
        });

        TextView LeftCredit = findViewById(R.id.left_nav_menu_credit);
        LeftCredit.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "信用分", Toast.LENGTH_SHORT).show();
            }
        });

        //设置
        LinearLayout LeftSetting = findViewById(R.id.left_nav_setting);
        LeftSetting.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "设置", Toast.LENGTH_SHORT).show();
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

//    @Override
//    public boolean onSupportNavigateUp() {
//        NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
//        return NavigationUI.navigateUp(navController, mAppBarConfiguration)
//                || super.onSupportNavigateUp();
//    }
}